#pragma once

#include "IImageProcStepLibDyn.h"
#include "ImageProcStepLibAuto.h"
#include "ImageProcStepLibs.h"

class ImageProcDummyLib : public IImageProcStepLibDyn 
{
public:
	static const char * const ImageProcStepDummyLibPathfileName;
	static const char * const ImageProcStepDummyLibFileName;
	static const char * const ImageProcStepDummyLibVersion;
	static const char * const ImageProcStepDummyLibFnCalcAvBrightness;
	static const int		  ImageProcStepDummyLibIVer = 1;

public:
	static ImageProcDummyLib *UnitTestCreateImageProcDummyLib();
	virtual ~ImageProcDummyLib(void);

	void				SetLibNameForUnitTest(const char *name);  

	virtual const char *GetLibVersion() { return (IsApiValid() ? _LibApi->GetVersion() : '\0'); }
	virtual const char *GetLibName() { return (IsApiValid() ? _LibApi->GetName() : '\0'); }
	virtual int			GetLibInterfaceVersion() { return (IsApiValid() ? _LibApi->GetIVersion() : ImageProcStepLibs::BadDllInterface); }		//interface version is incremented after any change to ImageProcStepLibAuto, ProcParamsInputs or ProcParamsOutputs (or their base classes)
	
	virtual void		Delete() { ; } //remove: delete this;  - ImageProcDummyLib is created by ImageExptLibTest rather than by a DLL
	virtual bool		Run(const char *fnName, ProcParamsInputs *inputs, ProcParamsOutputs *outputs);

	virtual bool					IsApiValid() { return ((_LibApi != '\0') ? _LibApi->IsValid(): false ); }			   //if returns true, then GetLibApi() is guaranteed to return a valid pointer to a good ProcDef
	virtual ImageProcStepLibAuto   *GetLibApi() { return (IsApiValid() ? _LibApi : '\0'); }

protected:
	ImageProcDummyLib(void);
private:
	ImageProcDummyLib(const char *UnitTestName);

	std::string         _UnitTestLibName;
	bool				_UnitTestCreated;
	ImageProcStepLibAuto *_LibApi;
};

